Add support for AIFF files and other WAV formats #877
+8,943
−196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(cherry picked from commit DeeJayLSP/godot@8345199)
Original PR: godotengine/godot#96545
Changes
In
ResourceImporterWAV::import()
, replaces the entire data read step with one that usesdr_wav
.Formats already supported by Godot and loop info detection should remain supported without regressions.
Extra WAV encoding formats like A-law, μ-law, MS ADPCM and IMA ADPCM can now be imported.
AIFF support
dr_wav
is also able to read AIFF files, soResourceImporterWAV
was enabled to recognize it too.The importer was renamed from
Microsoft WAV
toMicrosoft WAV/Apple AIFF
to reflect that.When it comes to sound effects, freesound.org provides much more AIFF than Ogg Vorbis files, so I thought adding support was reasonable:
wave
,aif
,aiff
andaifc
file extensions have been added as recognized extensions alongsidewav
.Others
Since both
AudioStreamWAV
andResourceImporterWAV
use a 32-bit integer variable to store the amount of PCM frames, I added a check that denies import if the number of frames exceedINT32_MAX
. This doesn't break compatibility, as attempting to import a file bigger than that would likely crash the editor